#include<iostream>
#include<vector>
using namespace std;

int main()
{
  vector<int> v1;//无参构造
  vector<int> v2(5,55);//构造有5个55的vector
  vector<int> v3(v2);//拷贝构造
  vector<int> v4(v3.begin(),v3.end());//迭代器区间构造
  for(auto ch : v1)
  {
    cout << ch<<" ";
  }
  cout << endl;
  for(auto ch : v2)
  {
    cout << ch<<" ";
  }
  cout << endl;
  for(auto ch : v3)
  {
    cout << ch<<" ";
  }
  cout << endl;
  for(auto ch : v4)
  {
    cout << ch<<" ";
  }
  cout << endl;
  vector<int>:: iterator it1 = v2.begin();
  while(it1!=v2.end())
  {
    cout << *it1 << " ";
    it1++;
  }
  cout << endl;
  const vector<int> v5;
  vector<int>::const_iterator it2 = v5.begin();
  while(it2!=v5.end())
  {
    cout << *it2 << " ";
    it2++;
  }
  cout << endl;
  vector<int>:: reverse_iterator it3 = v2.rbegin();
  while(it3!=v2.rend())
  {
    cout << *it3 << " ";
    it3++;
  }
  cout << endl;
  const vector<int> v6;
  vector<int>::const_reverse_iterator it4 = v6.rbegin();
  while(it4!=v6.rend())
  {
    cout << *it4 << " ";
    it4++;
  }
  cout << endl;

  cout << v2.size() << endl;
  cout << v2.capacity() << endl;
  cout << v2.empty() << endl;
  v2.reserve(100);
  cout << v2.size() << endl;
  cout << v2.capacity() << endl;
  v2.resize(10,6);
  cout << v2.size() << endl;
  cout << v2.capacity() << endl;




  vector<int> vec;
  vec.push_back(1);
  vec.push_back(2);
  vec.push_back(3);
  vec.pop_back();
  vec.insert(vec.end(),10);
  vec.insert(vec.end(),20);
  vec.insert(vec.end(),30);
  vec.erase(vec.begin());
  for(size_t i=0;i<vec.size();i++)
  {
    cout << vec[i] << " ";
  }
  cout << endl;
  return 0;
}
